const BASE_RUL = 'https://api2105.h5project.cn/1.1'
export const $requests = (url, method="GET", data={}) => {
	return new Promise((resolve, reject) => {
		uni.request({
			url: BASE_RUL + url,
			method,
			data,
			header: {
				"X-LC-Id":"7yoqQxyLBNN9MW5rsgTGXbHL-gzGzoHsz",
				"X-LC-Key":"hA8yGYuHjnXWRui1rzTe0C3P",
				"Content-Type":"application/json"
			},
			success: (res) => {
				console.log((url))
				resolve(res.data)
			},
			fail: (err) => {
				console.log((222))
				reject(err)
			}
		})
	})
}
export const $get = (url, data) => {
	return $requests(url, 'GET', data)
}
export const $post = (url, data) => {
	return $requests(url, 'POST', data)
}
// export default requests